import { combineReducers } from 'redux';
import { rootCom, RootNavigator } from '../../route/StartStack';
import animation from './animation'
import login from './login_reducer'

import verification from './verification_code_reducer'
import register from './register_reducer'
import share from './share_reducer'
import classify from './classify_reducer'
import recentData from './recentData';
import classifyData from './classifyData';
import search_reducer from './search_reducer';
import rankingData from './ranking_reducer';
import feedback from './feedback_reducer';
import collection from './collection_reducer';
import comment from './comment_reducer';
import Episodes from './epios'
// import moduleName from 'module'

const navState = RootNavigator.router.getStateForAction(
    RootNavigator.router.getActionForPathAndParams(rootCom)
);

const navReducer = (state = navState, action) => {
    const nextState = RootNavigator.router.getStateForAction(action, state);
    return nextState || state;
};

const index = combineReducers({
    nav: navReducer,
    animation: animation,
    login: login,
    verification: verification,
    register: register,
    share: share,
    classify: classify,
    recentData: recentData,
    classifyData: classifyData,
    searchResult: search_reducer,
    rankingData: rankingData,
    feedback: feedback,
    collection: collection,
    comment: comment,
    Episodes: Episodes,
});

export default index;